package mathproblem;
import java.util.Scanner;

public class Test1 {
	public static void main(String[] args){
		System.out.println("请选择您要输入的立方体（1、圆柱体	2、圆锥体	3、球）,输入0结束");
		Scanner input=new Scanner(System.in);
		int a=input.nextInt();
		double vol1=0,vol2=0,vol3=0;
		double are1=0,are2=0,are3=0;
		while(a!=0)
		{
			switch(a){
			case 1:
				System.out.println("请输入半径和高：");
				Scanner inputr1=new Scanner(System.in);
				double radius=inputr1.nextDouble();
				Scanner inputh1=new Scanner(System.in);
				double high=inputh1.nextDouble();
				Define col=new Define(radius,high,"圆柱体");
				vol1+=col.cylinderv(radius,high);
				are1+=col.cylindera(radius, high);
				break;
			case 2:
				System.out.println("请输入半径和高：");
				Scanner inputr2=new Scanner(System.in);
				double radius2=inputr2.nextDouble();
				Scanner inputh2=new Scanner(System.in);
				double high2=inputh2.nextDouble();
				Define col2=new Define(radius2,high2,"圆锥体");
				vol2+=col2.conev(radius2,high2);
				are2+=col2.conea(radius2,high2);				
				break;
			case 3:
				System.out.println("请输入半径：");
				Scanner inputr3=new Scanner(System.in);
				double radius3=inputr3.nextDouble();
				double high3=radius3;
				Define col3=new Define(radius3,high3,"球");
				vol3+=col3.ballv(radius3);
				are3+=col3.balla(radius3);				
				break;
			}
			System.out.println("请选择您要输入的立方体（1、圆柱体	2、圆锥体	3、球）,输入0结束");
			Scanner in=new Scanner(System.in);
			a=in.nextInt();
		}
		System.out.println("圆柱体的总面积为"+are1+"体积为"+vol1);
		System.out.println("圆锥体的总面积为"+are2+"体积为"+vol2);
		System.out.println("球的总面积为"+are3+"体积为"+vol3);		
	}
}
